$(function() {
	$("#saveBtn").click(function() {
		saveDepartment();
	}).button();

	$("#usersBtn").click(function() {
		doGet("admin/department/users?deptId="+deptId);
	}).button();
	$("#selparent").click(function() {
		
	}).button();
});
function saveDepartment() {
	var act = action || "create";
	var ps = $("form.deptForm").serialize();
	var postdata = "";
	if ($("#parent").val() != '')
		postdata += "&bean.parent.id=" + $("#parent").val();
	postdata+="&bean.id="+deptId+"&bean.name=" + $("#name").val();
	postdata+="&bean.sortNum="+$("#sortNum").val();
	//alert(ps+"\n\n\n"+postdata);
	doSubmit('admin/department/department!'+act, ps);
}